package com.naiterui.ehp.bs.payment.entity;

import static javax.persistence.GenerationType.IDENTITY;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Version;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 支付流水号
 *
 * @author 王泽浩
 * @since 1.0.0
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Entity
@Table(name = "trade_flow_record")
public class TradeFlowRecord implements Serializable {
    private static final long serialVersionUID = -6235163979406876957L;

    /**
     * 主键
     */
    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "id", nullable = false)
    private Long id;

    /**
     * 业务订单号
     */
    @Column(name = "order_sn")
    private String orderSn;

    /**
     * 交易单号
     */
    @Column(name = "trade_sn")
    private String tradeSn;

    /**
     * 交易平台
     */
    @Column(name = "origin")
    private Integer origin;

    /**
     * 用户标识
     */
    @Column(name = "user_id")
    private String userId;

    /**
     * 操作原因
     */
    @Column(name = "message")
    private String message;
    /**
     * 创建时间
     */
    @Column(name = "created_at")
    private Date createdAt;

    /**
     * 创建人
     */
    @Column(name = "created_by")
    private String createdBy;

    /**
     * 修改人
     */
    @Column(name = "changed_by")
    private String changedBy;

    /**
     * 修改时间
     */
    @Column(name = "changed_at")
    private Date changedAt;

    /**
     * 乐观锁
     */
    @Version
    @Column(name = "version")
    private Integer version;

}
